package com.zzy.app.config;

import com.zzy.app.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;

/**
 * 在IOCTest test2中研究bean scope
 */
@Configuration
public class MainConfig2 {

    //@Scope("prototype")
    //@Lazy
    @Bean
    public Person person() {
        System.out.println("此时实例化了person bean！");
        return new Person("zzy", 18);
    }
}
